#!/usr/bin/python



"""
	This class is used to implement a priority system when retrieving information from databases: it gives a list of ontologies for each priority level, so that request can be made only on these ontologies.
"""

class Priority:
	
	def __init__(self, priority_levels):
		self.priority_levels = priority_levels
	
############################################################

class PriorityLevel:
	
	# @param description - describes the purpose of this level in a user-understandable way
	# @param ontologies : name of a function in OntologyManager expected to return a list of ontologies:string.
	def __init__(self, description, ontologies):
		""" Defines a new priority level.
			:Parameters:
				`description` : str
					A user-readable description of this priority level.
				`ontologies` : str
					A method name to get the ontologies at this level. A method with this name has to be defined in the OntologyManager class and return a set of ontologies URIs (strings). Otherwise this priority level will be ignored.
		"""
		
		self.description = description
		self.ontologies = ontologies

############################################################

# constants
DEFAULT_PRIORITY = Priority(
	[
		PriorityLevel("your own ontologies", "getOwnOntologies"),
		PriorityLevel("selected ontologies", "getSelectedOntologies"),
		PriorityLevel("usual ontologies", "getNonTechnicalOntologies"),
		PriorityLevel("fantomatic ontologies", "functionThatDoesNotExist_justToTest_removeIt"),
		PriorityLevel("all ontologies", "getAllOntologies"),
		PriorityLevel("all contexts", "getAllContexts")
	]
)
